package vtt.android.cartoon_video.database;

import android.content.Context;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;

public class BaseDAO {

    protected SQLiteDatabase mDB;
    protected MySQLiteOpenHelper mDBHelper;

    public BaseDAO(Context context) {
        mDBHelper = new MySQLiteOpenHelper(context);
    }

    public void open() throws SQLException {
        if (mDB == null) {
            mDB = mDBHelper.getWritableDatabase();
        }
    }

    public void close() {
        mDBHelper.close();
    }
}
